<?php
namespace Home\Controller;
use Think\Controller;
class InformController extends Controller {


	public function getAllInform(){
		//获取所有大师信息
		$informModel=M('inform');
		$inform_id=$_GET['inform_id'];
		$inform=$informModel->table('inform i,users u,admin a')->where('i.user_id=u.user_id')->select();
		$this->inform=$inform;
		$this->ajaxReturn($inform,'JSON');
		echo json_encode($inform);

	}
	public function getInformById(){
		//获取大师详情页面
		$informDetailModel=M('inform');
		$inform_id=$_GET['inform_id'];
		$informDetail=$informDetailModel->table('inform i,users u,admin a')->where("i.inform_id='$inform_id' and i.user_id=u.user_id")->field('i.inform_id,i.inform_content,i.createtime,u.username,a.admin_name')->select();
		//$inform=$informModel->table('inform i,admin a')->where('i.admin_id=a.admin_id')->select();
		$this->informDetail=$informDetail;
		$this->ajaxReturn($informDetail,'JSON');
		//echo json_encode($informDetail);
	}
	// 	public function classlist(){
	// 	$class=M('club_class');
	// 	$club_id=$_GET['club_id'];
	// 	$result=$class->where("club_id='$club_id'")->select();
	// 	//dump($result);
	// 	echo json_encode($result);
	// }
	// public function videolist(){
	// 	$video=M('club_video');
	// 	$club_id=$_GET['club_id'];
	// 	$result=$video->where("club_id='$club_id'")->select();
	// 	echo json_encode($result);
	// }
	// public function typelist(){
		
	// }
}
?>